//
//  MRHttpTool.h
//  MReader
//
//  Created by Qi Liu on 2020/4/5.
//  Copyright © 2020 Qi Liu. All rights reserved.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface BLHttpTool : NSObject
+(void) getHttpRequest:(NSString *)urlpath param:(NSDictionary *)params finish:( void (^)(NSURLSessionDataTask *data,NSDictionary *obj))successBlock failedBlock:(void (^)(id  data, NSError *error))failedBlock;

+ (void)postWithPath:(NSString *)path
                 params:(NSDictionary *)params
           successBlock:(void (^)(NSDictionary *obj))successBlock
            failedBlock:(void(^)(NSURLSessionDataTask *data,NSError *error))failedBlock;
+(void)postJson:(NSString*)url params:(NSDictionary *)params  successBlock:(void (^)(NSDictionary *obj))successBlock failedBlock:(void(^)(NSError *error))failedBlock;

//下载相关
+(NSURLSessionDownloadTask *)downloadWithUrl:(NSString *)urlStr
   progress:(void (^)(NSProgress *downloadProgress)) downloadProgressBlock
destination:(NSURL * (^)(NSURL *targetPath, NSURLResponse *response))destination
                            completionHandler:(void (^)(NSURLResponse *response, NSURL *filePath, NSError *error))completionHandler;
@end

NS_ASSUME_NONNULL_END
